@tailwind base;
@tailwind components;
@tailwind utilities;

pre {
  line-height: 2;
}

nav {
  --details-force-closed: (max-width: 1023px);
}

@media (min-width: 1024px) {
  header>nav details>summary {
    display: none;
  }
}

nav details>summary {
  display: none;
}

.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: .1em;
}

a[href].direct-link,
a[href].direct-link:visited {
  color: transparent;
}

a[href].direct-link:focus,
a[href].direct-link:focus:visited,
:hover>a[href].direct-link,
:hover>a[href].direct-link:visited {
  color: theme('colors.almond.600')
}

.animate-twinkle {
  position: absolute;
  animation: twinkle 10s infinite ease-out;
}

@keyframes twinkle {
  0% {
    opacity: 1;
  }

  5% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  50% {
    opacity: 1;
  }

  55% {
    opacity: 0;
  }

  60% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.animate-glow {
  transition: box-shadow;
  animation: glow 4s infinite ease-in-out;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 4px theme('colors.red.600');
  }

  25% {
    box-shadow: 0 0 8px theme('colors.red.600');
  }

  50% {
    box-shadow: 0 0 6px theme('colors.red.600');
  }

  75% {
    box-shadow: 0 0 8px theme('colors.red.600');
  }

  100% {
    box-shadow: 0 0 4px theme('colors.red.600');
  }
}

#demo_frame {
  border: 1px solid #000;
  border-radius: 0.3em;
  overflow: auto;
  padding: .5rem;
  font-family: theme('fontFamily.sans');
  background: #fff;
}

#demo_frame #demo :where(h1, h2, h3, h4, h5, h6) {
  margin-top: 0;
}

#demo_frame #demo button {
  padding: .5rem .75rem;
  font-weight: 600;
  background: theme('colors.blue.800');
  line-height: 1.25;
  font-size: theme('fontSize.sm');
  color: #fff;
}

#demo_frame #demo table {
  width: 100%;
  text-align: left;
}

#demo_frame #demo td {
  border-color: theme('colors.gray.200');
}

#demo_frame #demo input,
#demo_frame #demo select,
#demo_frame #demo textarea {
  font-family: theme('fontFamily.sans');
  margin-bottom: 1rem;
  padding: .25rem .5rem;
  border-color: #000;
}

#demo_frame #demo td>input,
#demo_frame #demo td>select,
#demo_frame #demo td>textarea {
  margin-bottom: 0;
}

#demo_frame #demo dialog {
  border: 1px solid #000;
  border-radius: 0;
  padding: 1rem;
  max-width: 56ch;
  position: fixed;
  top: 50vh;
  margin-left: auto;
  margin-right: auto;
  transform: translate(0, -50%);
}
